package ncme.auto.framework.test.permission.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import ncme.auto.framework.core.annotation.entity.AllowNull;
import ncme.auto.framework.core.annotation.entity.VerifyRepetitionField;
import ncme.auto.framework.core.typeHandler.DateTypeHandler;

import java.util.Date;

@TableName("permission_role")
public class Role {

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

	@VerifyRepetitionField
	private String name;

	@AllowNull
	private String description;

    private String creator;

    @TableField(typeHandler = DateTypeHandler.class)
    private String createTime;

    private String editor;

    @TableField(typeHandler = DateTypeHandler.class)
    private String editTime;

    @TableLogic
    private Date isDeleted;

    @Version
    private Integer version;

    public Integer getId() { return id; }

    public void setId(Integer id) { this.id = id; }

    public String getName() { return name; }

    public void setName(String name) { this.name = name; }

    public String getDescription() { return description; }

    public void setDescription(String description) { this.description = description; }

    public String getCreator() { return creator; }

    public void setCreator(String creator) { this.creator = creator; }

    public String getCreateTime() { return createTime; }

    public void setCreateTime(String createTime) { this.createTime = createTime; }

    public String getEditor() { return editor; }

    public void setEditor(String editor) { this.editor = editor; }

    public String getEditTime() { return editTime; }

    public void setEditTime(String editTime) { this.editTime = editTime; }

    public Date getIsDeleted() { return isDeleted; }

    public void setIsDeleted(Date isDeleted) { this.isDeleted = isDeleted; }

    public Integer getVersion() { return version; }

    public void setVersion(Integer version) { this.version = version; }

    @Override
    public String toString() {
    return "role{" +
            "id=" + id +
            ", name=" + name +
            ", description=" + description +
            ", creator=" + creator +
            ", createTime=" + createTime +
            ", editor=" + editor +
            ", editTime=" + editTime +
            ", isDeleted=" + isDeleted +
            ", version=" + version +
            '}';
    }

}
